package com.shangjinrong.controller.admin;

import com.shangjinrong.domain.UserLoginRecord;
import com.shangjinrong.result.R;
import com.shangjinrong.service.UserLoginRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("admin/userLoginRecord")
@Slf4j
public class AdminUserLoginRecordController {

    @Autowired
    private UserLoginRecordService userLoginRecordService;

    @GetMapping("listTop50/{userId}")
    public R listTop50(
            @PathVariable Long userId) {
        List<UserLoginRecord> userLoginRecordList = userLoginRecordService.listTop50(userId);
        return R.ok().data("list", userLoginRecordList);
    }
}
